import request from '@/utils/request'

/* 登录 */
export const login = (params) => {
    return request({
        url: '/login',
        method: 'get',
        params: params
    })
}
// 获取三方登录授权地址
export const getAuthorizeUrl = (platform) => {
    return request({
        url: `/login/authorize-url/${platform}`,
        method: 'get',
    })
}
// 三方平台登录
export const thirdPartyLogin = (params) =>{
    return request({
        url: '/login/third-party',
        method: 'get',
        params: params
    })
}
// 第三方登录 绑定主账号
export const bindUser = (params) => {
    return request({
        url: '/system/userThirdParty/bindUser',
        method: 'get',
        params: params
    })
}
// qq登录
export const qqLogin = (params) => {
    return request({
        url: '/login/qq',
        method: 'get',
        params: params
    })
}
// Gitee登录
export const giteeLogin = (params) => {
    return request({
        url: '/login/gitee',
        method: 'get',
        params: params
    })
}
// 微博登录
export const weiboLogin = (params) => {
    return request({
        url: '/login/weibo',
        method: 'get',
        params: params
    })
}

export const getQrCode = (params) => {
    return request({
        url: '/weixin/qrcode/create',
        method: 'get',
        params: params
    })
}
export const checkQrCode = (params) => {
    return request({
        url: '/weixin/qrcode/check',
        method: 'get',
        params: params
    })
}

// 注册方法
export function register(data) {
  return request({
    url: '/system/user',
    method: 'post',
    data: data
  })
}

// 退出登录
export function logout() {
  return request({
    url: '/auth/logout',
    method: 'post'
  })
}